package Month10.day1012;

public class Test3 {
    public static void main(String[] args) {
        test();
    }
    public static int test() {
        try {
            int[] a = {1,2,3,4,5,6,7};
            System.out.println(a[4]);
            System.out.println("内部这里执行了");
            return  0;
        }catch (NullPointerException e){
            e.printStackTrace();
        }catch(ArrayIndexOutOfBoundsException e){
          e.printStackTrace();
        } finally {
            System.out.println("这里的代码块总会执行");
        }
        System.out.println("外部这里执行了");
        return 0;
    }
}
